home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 2
/
The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO
/
pascal
/
ghostbbs.zip
/
MAILCLR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1986-04-20
|
3KB
|
101 lines
program mailclr;
type
messages = record
sender :string[27];
recver :string[25];
subject :string[25];
date :string[14];
messno :integer;
pointer :integer;
end;
name = string[14];
longname = string[25];
filbuffer = array[0..127] of byte;
line = string[80];
person = string[27];
str10 = string[10];
long = string[150];
{$I id.rec }
var
infile, outfile : file of messages;
idfile : file of sysid;
goodmess,badmess,not_here,count,usernum : integer;
messrec : messages;
exists : boolean;
temprec : sysid;
procedure find_name(name:person; var num:integer; var gotit:boolean);
{pass this procedure a username and it will tell you if it was found or not
and what his user number is }
var
found : byte;
begin
found := 0;
num := -1;
assign(idfile,'IDS.BBS');
reset(idfile);
while(found = 0) do
begin
num := num + 1;
{$I-}
read(idfile,temprec);
{$I+}
if ioresult <> 0 then found := 2;
if temprec.user = name then found := 1;
end;
close(idfile);
gotit := (found = 1);
end;
begin
goodmess := 0; badmess := 0; count := 0; not_here := 0;
assign(infile,'TITLE0.BBS'); assign(outfile,'Temp.tle');
reset(infile); rewrite(outfile);
while not eof(infile) do
begin
count := count + 1;
read(infile,messrec);
if messrec.recver = '***'
then begin
writeln('Message received #',count);
badmess := badmess + 1;
end
else begin
find_name(messrec.recver,usernum,exists);
case exists of
true : begin
if temprec.pass = '***'
then begin
writeln(messrec.recver,' not found #',count);
not_here := not_here + 1;
end
else begin
writeln(messrec.recver,' #',count);
goodmess := goodmess + 1;
write(outfile,messrec);
end;
end;
false : begin
writeln(messrec.recver,' not found #',count);
not_here := not_here + 1;
end;
end; { case }
end;
end;
close(infile);
close(outfile);
writeln('Total processed = ',count);
writeln('Total recieved = ',badmess);
writeln('Total not found = ',not_here);
writeln('Total pending = ',goodmess);
end.